package com.javaspeak.concurrency.pattern.actor;

/**
 * @author John Dickerson
 */
public class MethodResponse {

	private Object response;
    private Exception exception;

    public MethodResponse( Object response ) {

    	this.response = response;
    }


    public MethodResponse( Exception exception ) {

    	this.exception = exception;
    }


    public Object getResponse() throws Exception {

    	if ( exception != null ) {

    		throw exception;
    	}

        return response;
    }
}
